const WebSocketClient = require('websocket').client;
const fs = require('fs');

const client = new WebSocketClient();
client.connect('ws://localhost:8080/ws/receive');

const arrayData = [];

client.on('connect', connection => {
  fs.readFile('./README.md', (err, data) => {
    console.log(data.byteLength);
    connection.sendUTF(data.toString(), err => {
      console.log(err);
    });
  })
});
